home *** CD-ROM | disk | FTP | other *** search
- Path: clri6a.gsi.de!kraemer
- From: kraemer@clri6a.gsi.de (Michael Kraemer)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: More linked list nonsense
- Date: 24 Jan 1996 17:54:44 GMT
- Organization: Technische Hochschule Darmstadt
- Message-ID: <4e5rp4$tub@rs18.hrz.th-darmstadt.de>
- References: <4e5nih$iib@news.sdd.hp.com>
- NNTP-Posting-Host: clri6a.gsi.de
-
- In article <4e5nih$iib@news.sdd.hp.com>, Jeff Grimmett <jgrimm@sdd.hp.com> writes:
- >
- > Howdy,
- >
- > It just occurred to me last night, as I pored over steaming code, that
- > the function Remove() (used to remove nodes from linked lists) might
- > POSSIBLY not be freeing the memory allocated to the node it is removing.
- > Does anyone have some insight on this? It's difficult to deallocate a
- > node once it's not part of the list, but it's pretty STUPID to free it
- > BEFORE. :-)
- >
- > It's also hard to imagine that C= gave us this function without some way
- > to clean up behind it, but I'm SUCH a Doubting Thomas at times... :-)
- >
- > Any info appreciated. Otherwise, I'm going to proceed on the assumtion
- > it's safe. It appears to be.
- >
- >
-
- struct Node *pln;
-
- Remove(pln); /* remove it from the list */
- free(pln); /* remove it from memory */
-